﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VSWClient.Utility
{
	public class Privilege
	{
		public static int levelone = 1;//1=operator, can operate task,downtime,query in main menu
		public static int leveltwo = 2;//2=power operator=1+report
		public static int levelthree = 3;//3=super operator= 2 + future function
		public static int levelfour = 4;//4=admin=3+usermanage and other functional modules
		public static bool  IsPrivilege(string userLevel,string tagLevel)
		{
			try
			{
				int userlevel = Convert.ToInt32(userLevel);
				int taglevel = Convert.ToInt32(tagLevel);
				bool result = true;
				if (userlevel< taglevel)
				{
					result = false;
				}
				return result;
			}
			catch (Exception ex)
			{
				LogHelper.WriteLog("IsPrivilege", ex);
				throw ex;
			}
		}
	}
}
